home *** CD-ROM | disk | FTP | other *** search
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Image;
-
- class First extends Canvas implements CommandListener {
- private static final Command[] COMMANDS = new Command[]{new Command("Start", 4, 2), new Command("Exit", 3, 4)};
- Fight parent = null;
- Image splash = null;
- Image logo = null;
- private boolean showLogo = true;
-
- public First(Fight var1) {
- this.parent = var1;
-
- try {
- this.splash = Image.createImage("splash.png");
- this.logo = Image.createImage("hglogo.png");
- } catch (Exception var3) {
- System.out.println("error creating logos");
- }
-
- ((Displayable)this).setCommandListener(this);
- }
-
- public void paint(Graphics var1) {
- try {
- if (this.showLogo) {
- var1.drawImage(this.logo, 6, 16, 20);
- this.showLogo = false;
- ((Canvas)this).repaint();
- Thread.sleep(2000L);
-
- for(int var2 = 0; var2 < COMMANDS.length; ++var2) {
- ((Displayable)this).addCommand(COMMANDS[var2]);
- }
- } else {
- var1.drawImage(this.splash, 0, 0, 20);
- }
- } catch (Exception var3) {
- }
-
- }
-
- public void commandAction(Command var1, Displayable var2) {
- if (var1 == COMMANDS[0]) {
- this.parent.choosePlayer = new ChoosePlayerCanvas(this.parent);
- this.parent.showChoose();
- }
-
- if (var1 == COMMANDS[1]) {
- this.parent.destroyApp(true);
- }
-
- }
- }
-